using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;

namespace NGIS.Model
{
	public class ModelAttribute : IModelAttribute
	{
		private List<LocalAttribute> mLocalAttributeList = new List<LocalAttribute>();

		private List<ModelCategory> mModelCategoryList = new List<ModelCategory>();

		private List<ModelUser> mAuthors = new List<ModelUser>();

		private List<ModelUser> mBuilders = new List<ModelUser>();

		private List<ModelUser> mWrappers = new List<ModelUser>();

		public bool loadFromXml(XmlElement pModelClassElement)
		{
			XmlElement xmlElement = (XmlElement)pModelClassElement.ChildNodes[0];
			XmlElement xmlElement2 = (XmlElement)xmlElement.ChildNodes[0];
			XmlElement xmlElement3 = (XmlElement)xmlElement.ChildNodes[1];
			foreach (object childNode in xmlElement2.ChildNodes)
			{
				XmlElement xmlElement4 = childNode as XmlElement;
				ModelCategory item = default(ModelCategory);
				item.principle = xmlElement4.GetAttribute("principle");
				item.path = xmlElement4.GetAttribute("path");
				mModelCategoryList.Add(item);
			}
			foreach (object childNode2 in xmlElement3.ChildNodes)
			{
				XmlElement xmlElement5 = childNode2 as XmlElement;
				LocalAttribute item2 = default(LocalAttribute);
				item2.localName = xmlElement5.GetAttribute("localName");
				item2.wikiUrl = xmlElement5.GetAttribute("wiki");
				string attribute = xmlElement5.GetAttribute("local");
				ELocalizationType eLocalizationType = item2.localType = LocalizationHelper.String2LocalizationType(attribute);
				XmlElement xmlElement6 = (XmlElement)xmlElement5.ChildNodes[0];
				XmlElement xmlElement7 = (XmlElement)xmlElement5.ChildNodes[1];
				string innerText = xmlElement6.InnerText;
				item2.abstractInfo = xmlElement7.InnerText;
				List<string> list = innerText.Split(';').ToList();
				item2.keywords = new List<string>();
				for (int i = 0; i < list.Count; i++)
				{
					item2.keywords.Add(list[i]);
				}
				if (xmlElement5.ChildNodes.Count > 2)
				{
					XmlNodeList elementsByTagName = xmlElement5.GetElementsByTagName("Mechanism");
					if (elementsByTagName.Count > 0)
					{
						XmlElement xmlElement8 = (XmlElement)elementsByTagName[0];
						item2.mechanismItems = new List<ModelMechanismItem>();
						foreach (XmlElement item4 in xmlElement8)
						{
							string attribute2 = item4.GetAttribute("name");
							EMechanismItemType eMechanismItemType = LocalizationHelper.String2MechanismItemType(item4.GetAttribute("type"));
							string text = "";
							text = ((eMechanismItemType != EMechanismItemType.EMIT_Text) ? item4.GetAttribute("value") : item4.InnerText);
							ModelMechanismItem item3 = new ModelMechanismItem(attribute2, eMechanismItemType, text);
							item2.mechanismItems.Add(item3);
						}
					}
					XmlNodeList elementsByTagName2 = xmlElement5.GetElementsByTagName("Application");
					if (elementsByTagName2.Count > 0)
					{
						XmlElement xmlElement10 = (XmlElement)elementsByTagName[0];
						XmlNodeList elementsByTagName3 = xmlElement10.GetElementsByTagName("SpatiotemporalScale");
						if (elementsByTagName3.Count > 0)
						{
							XmlElement xmlElement11 = (XmlElement)elementsByTagName3[0];
							ESpatiotemporalScaleType eSpatiotemporalScaleType = item2.sptimeScaleType = LocalizationHelper.String2SpatiotemporalScaleType(xmlElement11.GetAttribute("type"), xmlElement11.GetAttribute("scale"));
						}
						XmlNodeList elementsByTagName4 = xmlElement10.GetElementsByTagName("SpatiotemporalStepLength");
						if (elementsByTagName4.Count > 0)
						{
							XmlElement xmlElement12 = (XmlElement)elementsByTagName4[0];
							foreach (XmlElement childNode3 in xmlElement12.ChildNodes)
							{
								string name = childNode3.Name;
								string attribute3 = childNode3.GetAttribute("step");
								string attribute4 = childNode3.GetAttribute("unit");
								SpatiotemporalStepLength spatiotemporalStepLength = new SpatiotemporalStepLength(attribute3, attribute4);
								if (name == "X")
								{
									item2.sslX = new SpatiotemporalStepLength(attribute3, attribute4);
								}
								else if (name == "Y")
								{
									item2.sslY = new SpatiotemporalStepLength(attribute3, attribute4);
								}
								else if (name == "Z")
								{
									item2.sslZ = new SpatiotemporalStepLength(attribute3, attribute4);
								}
								else if (name == "T")
								{
									item2.sslT = new SpatiotemporalStepLength(attribute3, attribute4);
								}
							}
						}
						XmlNodeList elementsByTagName5 = xmlElement10.GetElementsByTagName("Scope");
						if (elementsByTagName5.Count > 0)
						{
							XmlElement xmlElement14 = (XmlElement)elementsByTagName5[0];
							item2.spatialScope = default(SpatialScope);
							item2.spatialScope.Extents = new List<SpatialExtent>();
							item2.spatialScope.AreaNames = new List<string>();
							XmlElement xmlElement15 = (XmlElement)xmlElement14.ChildNodes[0];
							XmlElement xmlElement16 = (XmlElement)xmlElement14.ChildNodes[1];
							foreach (XmlElement childNode4 in xmlElement15.ChildNodes)
							{
								double xmin = Convert.ToDouble(childNode4.GetAttribute("xMin"));
								double xmax = Convert.ToDouble(childNode4.GetAttribute("xMax"));
								double ymin = Convert.ToDouble(childNode4.GetAttribute("yMin"));
								double ymax = Convert.ToDouble(childNode4.GetAttribute("yMax"));
								string attribute5 = childNode4.GetAttribute("spatialReference");
								item2.spatialScope.Extents.Add(new SpatialExtent(xmin, xmax, ymin, ymax, attribute5));
							}
							foreach (XmlElement childNode5 in xmlElement16.ChildNodes)
							{
								string attribute6 = childNode5.GetAttribute("name");
								item2.spatialScope.AreaNames.Add(attribute6);
							}
						}
					}
				}
				mLocalAttributeList.Add(item2);
			}
			if (xmlElement.ChildNodes.Count > 2)
			{
				XmlNodeList elementsByTagName6 = xmlElement.GetElementsByTagName("Authors");
				if (elementsByTagName6.Count > 0)
				{
					XmlElement mele = (XmlElement)elementsByTagName6[0];
					mAuthors = LocalizationHelper.Xml2ModelUser(mele);
				}
				XmlNodeList elementsByTagName7 = xmlElement.GetElementsByTagName("Builders");
				if (elementsByTagName7.Count > 0)
				{
					XmlElement mele2 = (XmlElement)elementsByTagName7[0];
					mBuilders = LocalizationHelper.Xml2ModelUser(mele2);
				}
				XmlNodeList elementsByTagName8 = xmlElement.GetElementsByTagName("Wrappers");
				if (elementsByTagName8.Count > 0)
				{
					XmlElement mele3 = (XmlElement)elementsByTagName8[0];
					mWrappers = LocalizationHelper.Xml2ModelUser(mele3);
				}
			}
			return true;
		}

		public bool formatToXml(XmlElement pModelClassElement)
		{
			XmlDocument ownerDocument = pModelClassElement.OwnerDocument;
			XmlElement xmlElement = ownerDocument.CreateElement("AttributeSet");
			XmlElement xmlElement2 = ownerDocument.CreateElement("Categories");
			XmlElement xmlElement3 = ownerDocument.CreateElement("LocalAttributes");
			for (int i = 0; i < mModelCategoryList.Count; i++)
			{
				ModelCategory modelCategory = mModelCategoryList[i];
				XmlElement xmlElement4 = ownerDocument.CreateElement("Category");
				xmlElement4.SetAttribute("principle", modelCategory.principle);
				xmlElement4.SetAttribute("path", modelCategory.path);
				xmlElement2.AppendChild(xmlElement4);
			}
			for (int j = 0; j < mLocalAttributeList.Count; j++)
			{
				LocalAttribute localAttribute = mLocalAttributeList[j];
				XmlElement xmlElement5 = ownerDocument.CreateElement("LocalAttribute");
				xmlElement5.SetAttribute("local", LocalizationHelper.LocalizationType2String(localAttribute.localType));
				xmlElement5.SetAttribute("localName", localAttribute.localName);
				xmlElement5.SetAttribute("wiki", localAttribute.wikiUrl);
				XmlElement xmlElement6 = ownerDocument.CreateElement("Keywords");
				XmlElement xmlElement7 = ownerDocument.CreateElement("Abstract");
				XmlElement xmlElement8 = ownerDocument.CreateElement("Mechanism");
				XmlElement xmlElement9 = ownerDocument.CreateElement("Application");
				string text = "";
				for (int k = 0; k < localAttribute.keywords.Count; k++)
				{
					string str = localAttribute.keywords[k];
					text += str;
					if (k != localAttribute.keywords.Count - 1)
					{
						text += "; ";
					}
				}
				xmlElement6.InnerText = text;
				xmlElement7.InnerText = localAttribute.abstractInfo;
				if (localAttribute.mechanismItems != null)
				{
					for (int l = 0; l < localAttribute.mechanismItems.Count; l++)
					{
						XmlElement xmlElement10 = ownerDocument.CreateElement("Add");
						xmlElement10.SetAttribute("name", localAttribute.mechanismItems[l].Name);
						xmlElement10.SetAttribute("type", LocalizationHelper.MechanismType2String(localAttribute.mechanismItems[l].Type));
						xmlElement10.SetAttribute("value", localAttribute.mechanismItems[l].Value);
						xmlElement8.AppendChild(xmlElement10);
					}
				}
				XmlElement xmlElement11 = ownerDocument.CreateElement("SpatiotemporalScale");
				xmlElement11.SetAttribute("type", LocalizationHelper.SpatiotemporalScaleType2String(localAttribute.sptimeScaleType));
				xmlElement11.SetAttribute("scale", LocalizationHelper.SpatiotemporalScale2String(localAttribute.sptimeScaleType));
				xmlElement9.AppendChild(xmlElement11);
				XmlElement xmlElement12 = ownerDocument.CreateElement("SpatiotemporalStepLength");
				XmlElement xmlElement13 = ownerDocument.CreateElement("X");
				xmlElement13.SetAttribute("step", "[" + localAttribute.sslX.Min.ToString() + "," + localAttribute.sslX.Max.ToString() + "]");
				xmlElement13.SetAttribute("unit", localAttribute.sslX.Unit);
				xmlElement12.AppendChild(xmlElement13);
				XmlElement xmlElement14 = ownerDocument.CreateElement("Y");
				xmlElement14.SetAttribute("step", "[" + localAttribute.sslY.Min.ToString() + "," + localAttribute.sslY.Max.ToString() + "]");
				xmlElement14.SetAttribute("unit", localAttribute.sslY.Unit);
				xmlElement12.AppendChild(xmlElement14);
				XmlElement xmlElement15 = ownerDocument.CreateElement("Z");
				xmlElement15.SetAttribute("step", "[" + localAttribute.sslZ.Min.ToString() + "," + localAttribute.sslZ.Max.ToString() + "]");
				xmlElement15.SetAttribute("unit", localAttribute.sslZ.Unit);
				xmlElement12.AppendChild(xmlElement15);
				XmlElement xmlElement16 = ownerDocument.CreateElement("T");
				xmlElement16.SetAttribute("step", "[" + localAttribute.sslT.Min.ToString() + "," + localAttribute.sslT.Max.ToString() + "]");
				xmlElement16.SetAttribute("unit", localAttribute.sslT.Unit);
				xmlElement12.AppendChild(xmlElement16);
				xmlElement9.AppendChild(xmlElement12);
				XmlElement xmlElement17 = ownerDocument.CreateElement("Scope");
				XmlElement xmlElement18 = ownerDocument.CreateElement("ExtentGroup");
				if (localAttribute.spatialScope.Extents != null)
				{
					foreach (SpatialExtent extent in localAttribute.spatialScope.Extents)
					{
						XmlElement xmlElement19 = ownerDocument.CreateElement("Extent");
						double xMin = extent.XMin;
						xmlElement19.SetAttribute("xMin", xMin.ToString());
						xMin = extent.XMax;
						xmlElement19.SetAttribute("xMax", xMin.ToString());
						xMin = extent.YMin;
						xmlElement19.SetAttribute("yMin", xMin.ToString());
						xMin = extent.YMax;
						xmlElement19.SetAttribute("yMax", xMin.ToString());
						xmlElement19.SetAttribute("spatialReference", extent.SpatialReference.ToString());
						xmlElement18.AppendChild(xmlElement19);
					}
				}
				xmlElement17.AppendChild(xmlElement18);
				XmlElement xmlElement20 = ownerDocument.CreateElement("AreaGroup");
				if (localAttribute.spatialScope.AreaNames != null)
				{
					foreach (string areaName in localAttribute.spatialScope.AreaNames)
					{
						XmlElement xmlElement21 = ownerDocument.CreateElement("Area");
						xmlElement21.SetAttribute("name", areaName);
						xmlElement20.AppendChild(xmlElement21);
					}
				}
				xmlElement17.AppendChild(xmlElement20);
				xmlElement9.AppendChild(xmlElement17);
				xmlElement5.AppendChild(xmlElement6);
				xmlElement5.AppendChild(xmlElement7);
				xmlElement5.AppendChild(xmlElement8);
				xmlElement5.AppendChild(xmlElement9);
				xmlElement3.AppendChild(xmlElement5);
			}
			xmlElement.AppendChild(xmlElement2);
			xmlElement.AppendChild(xmlElement3);
			XmlElement xmlElement22 = ownerDocument.CreateElement("Authors");
			foreach (ModelUser mAuthor in mAuthors)
			{
				XmlElement xmlElement23 = ownerDocument.CreateElement("Author");
				xmlElement23.SetAttribute("name", mAuthor.Name);
				xmlElement23.SetAttribute("account", mAuthor.Account);
				XmlElement xmlElement24 = ownerDocument.CreateElement("Institution");
				xmlElement24.SetAttribute("name", mAuthor.Institution.Name);
				xmlElement24.SetAttribute("country", mAuthor.Institution.Country);
				xmlElement24.SetAttribute("city", mAuthor.Institution.City);
				xmlElement24.SetAttribute("address", mAuthor.Institution.Address);
				xmlElement23.AppendChild(xmlElement24);
				XmlElement xmlElement25 = ownerDocument.CreateElement("Contacts");
				foreach (ModelUserContact contact in mAuthor.Contacts)
				{
					XmlElement xmlElement26 = ownerDocument.CreateElement("Add");
					xmlElement26.SetAttribute("type", LocalizationHelper.ContactType2String(contact.Type));
					xmlElement26.SetAttribute("value", contact.Value);
					xmlElement25.AppendChild(xmlElement26);
				}
				xmlElement23.AppendChild(xmlElement25);
				xmlElement22.AppendChild(xmlElement23);
			}
			xmlElement.AppendChild(xmlElement22);
			XmlElement xmlElement27 = ownerDocument.CreateElement("Builders");
			foreach (ModelUser mBuilder in mBuilders)
			{
				XmlElement xmlElement28 = ownerDocument.CreateElement("Builder");
				xmlElement28.SetAttribute("name", mBuilder.Name);
				xmlElement28.SetAttribute("account", mBuilder.Account);
				XmlElement xmlElement29 = ownerDocument.CreateElement("Institution");
				xmlElement29.SetAttribute("name", mBuilder.Institution.Name);
				xmlElement29.SetAttribute("country", mBuilder.Institution.Country);
				xmlElement29.SetAttribute("city", mBuilder.Institution.City);
				xmlElement29.SetAttribute("address", mBuilder.Institution.Address);
				xmlElement28.AppendChild(xmlElement29);
				XmlElement xmlElement30 = ownerDocument.CreateElement("Contacts");
				foreach (ModelUserContact contact2 in mBuilder.Contacts)
				{
					XmlElement xmlElement31 = ownerDocument.CreateElement("Add");
					xmlElement31.SetAttribute("type", LocalizationHelper.ContactType2String(contact2.Type));
					xmlElement31.SetAttribute("value", contact2.Value);
					xmlElement30.AppendChild(xmlElement31);
				}
				xmlElement28.AppendChild(xmlElement30);
				xmlElement27.AppendChild(xmlElement28);
			}
			xmlElement.AppendChild(xmlElement27);
			XmlElement newChild = ownerDocument.CreateElement("Wrappers");
			foreach (ModelUser mWrapper in mWrappers)
			{
				XmlElement xmlElement32 = ownerDocument.CreateElement("Wrapper");
				xmlElement32.SetAttribute("name", mWrapper.Name);
				xmlElement32.SetAttribute("account", mWrapper.Account);
				XmlElement xmlElement33 = ownerDocument.CreateElement("Institution");
				xmlElement33.SetAttribute("name", mWrapper.Institution.Name);
				xmlElement33.SetAttribute("country", mWrapper.Institution.Country);
				xmlElement33.SetAttribute("city", mWrapper.Institution.City);
				xmlElement33.SetAttribute("address", mWrapper.Institution.Address);
				xmlElement32.AppendChild(xmlElement33);
				XmlElement xmlElement34 = ownerDocument.CreateElement("Contacts");
				foreach (ModelUserContact contact3 in mWrapper.Contacts)
				{
					XmlElement xmlElement35 = ownerDocument.CreateElement("Add");
					xmlElement35.SetAttribute("type", LocalizationHelper.ContactType2String(contact3.Type));
					xmlElement35.SetAttribute("value", contact3.Value);
					xmlElement34.AppendChild(xmlElement35);
				}
				xmlElement32.AppendChild(xmlElement34);
				xmlElement27.AppendChild(xmlElement32);
			}
			xmlElement.AppendChild(newChild);
			pModelClassElement.AppendChild(xmlElement);
			return true;
		}

		public int getLocalAttributeCount()
		{
			return mLocalAttributeList.Count;
		}

		public bool getLocalAttribute(int idx, ref LocalAttribute pLocalAttribute)
		{
			if (idx < 0 || idx >= mLocalAttributeList.Count)
			{
				return false;
			}
			pLocalAttribute = mLocalAttributeList[idx];
			return true;
		}

		public bool getLocalAttribute(ELocalizationType pLocalType, ref LocalAttribute pLocalAttribute)
		{
			for (int i = 0; i < mLocalAttributeList.Count; i++)
			{
				if (mLocalAttributeList[i].localType == pLocalType)
				{
					pLocalAttribute = mLocalAttributeList[i];
					return true;
				}
			}
			return false;
		}

		public bool addLocalAttributeInfo(ref LocalAttribute pLocalAttribute)
		{
			for (int i = 0; i < mLocalAttributeList.Count; i++)
			{
				if (mLocalAttributeList[i].localType == pLocalAttribute.localType)
				{
					return false;
				}
			}
			mLocalAttributeList.Add(pLocalAttribute);
			return true;
		}

		public bool removeLocalAttribute(int idx)
		{
			if (idx < 0 || idx >= mLocalAttributeList.Count)
			{
				return false;
			}
			mLocalAttributeList.RemoveAt(idx);
			return true;
		}

		public bool removeLocalAttribute(ref LocalAttribute pLocalAttribute)
		{
			if (mLocalAttributeList.Contains(pLocalAttribute))
			{
				mLocalAttributeList.Remove(pLocalAttribute);
				return true;
			}
			return false;
		}

		public bool updateLocalAttribute(int idx, ref LocalAttribute pLocalAttribute)
		{
			if (idx < 0 || idx >= mLocalAttributeList.Count)
			{
				return false;
			}
			mLocalAttributeList[idx] = pLocalAttribute;
			return true;
		}

		public bool updateLocalAttribute(ELocalizationType pLocalType, ref LocalAttribute pLocalAttribute)
		{
			for (int i = 0; i < mLocalAttributeList.Count; i++)
			{
				if (mLocalAttributeList[i].localType == pLocalType)
				{
					mLocalAttributeList[i] = pLocalAttribute;
					return true;
				}
			}
			return false;
		}

		public int getCategoryCount()
		{
			return mModelCategoryList.Count;
		}

		public bool getCategory(int idx, ref ModelCategory pModelCategory)
		{
			if (idx < 0 || idx >= mModelCategoryList.Count)
			{
				return false;
			}
			pModelCategory = mModelCategoryList[idx];
			return true;
		}

		public bool addCategoryInfo(ref ModelCategory pCategoryInfo)
		{
			for (int i = 0; i < mModelCategoryList.Count; i++)
			{
				ModelCategory modelCategory = mModelCategoryList[i];
				if (modelCategory.principle == pCategoryInfo.principle && modelCategory.path == pCategoryInfo.path)
				{
					return false;
				}
			}
			mModelCategoryList.Add(pCategoryInfo);
			return true;
		}

		public bool removeCategory(int idx)
		{
			if (idx < 0 || idx >= mModelCategoryList.Count)
			{
				return false;
			}
			mModelCategoryList.RemoveAt(idx);
			return true;
		}

		public bool removeCategory(ref ModelCategory pCategoryInfo)
		{
			if (mModelCategoryList.Contains(pCategoryInfo))
			{
				mModelCategoryList.Remove(pCategoryInfo);
				return true;
			}
			return false;
		}

		public bool updateCategory(int idx, ref ModelCategory pCategoryInfo)
		{
			if (idx < 0 || idx >= mModelCategoryList.Count)
			{
				return false;
			}
			mModelCategoryList[idx] = pCategoryInfo;
			return true;
		}

		public bool compareOther(IModelAttribute pAttribute, ref string obj, ref string name)
		{
			if (pAttribute.getCategoryCount() != mModelCategoryList.Count)
			{
				obj = "Categories";
				name = "CategoryCount";
				return false;
			}
			for (int i = 0; i < mModelCategoryList.Count; i++)
			{
				ModelCategory modelCategory = mModelCategoryList[i];
				ModelCategory pModelCategory = default(ModelCategory);
				pAttribute.getCategory(i, ref pModelCategory);
				if (!modelCategory.compareOther(pModelCategory))
				{
					obj = "Category";
					name = modelCategory.principle + "<->" + pModelCategory.principle;
					return false;
				}
			}
			if (pAttribute.getLocalAttributeCount() != mLocalAttributeList.Count)
			{
				obj = "LocalAttributes";
				name = "LocalAttributeCount";
				return false;
			}
			for (int j = 0; j < mLocalAttributeList.Count; j++)
			{
				LocalAttribute localAttribute = mLocalAttributeList[j];
				LocalAttribute pLocalAttribute = default(LocalAttribute);
				pAttribute.getLocalAttribute(j, ref pLocalAttribute);
				if (!localAttribute.compareOther(pLocalAttribute))
				{
					obj = "Category";
					name = localAttribute.localType + "<->" + pLocalAttribute.localType;
					return false;
				}
			}
			return true;
		}

		public int getAuthorsCount()
		{
			return mAuthors.Count;
		}

		public bool getAuthor(int index, ref ModelUser author)
		{
			if (mAuthors.Count - 1 < index)
			{
				return false;
			}
			author = mAuthors[index];
			return true;
		}

		public bool addAuthor(ref ModelUser author)
		{
			if (!mAuthors.Contains(author))
			{
				mAuthors.Add(author);
				return true;
			}
			return false;
		}

		public bool removeAuthor(int index)
		{
			if (mAuthors.Count - 1 < index)
			{
				return false;
			}
			mAuthors.RemoveAt(index);
			return true;
		}

		public int getBuildersCount()
		{
			return mBuilders.Count;
		}

		public bool getBuilder(int index, ref ModelUser builder)
		{
			if (mBuilders.Count - 1 < index)
			{
				return false;
			}
			builder = mBuilders[index];
			return true;
		}

		public bool addBuilder(ref ModelUser builder)
		{
			if (!mBuilders.Contains(builder))
			{
				mBuilders.Add(builder);
				return true;
			}
			return false;
		}

		public bool removeBuilder(int index)
		{
			if (mBuilders.Count - 1 < index)
			{
				return false;
			}
			mBuilders.RemoveAt(index);
			return true;
		}

		public int getWrappersCount()
		{
			return mWrappers.Count;
		}

		public bool getWrapper(int index, ref ModelUser wrapper)
		{
			if (mWrappers.Count - 1 < index)
			{
				return false;
			}
			wrapper = mWrappers[index];
			return true;
		}

		public bool addWrapper(ref ModelUser wrapper)
		{
			if (!mWrappers.Contains(wrapper))
			{
				mWrappers.Add(wrapper);
				return true;
			}
			return false;
		}

		public bool removeWrapper(int index)
		{
			if (mWrappers.Count - 1 < index)
			{
				return false;
			}
			mWrappers.RemoveAt(index);
			return true;
		}
	}
}
